{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Importing PulP solver\n",
    "from pulp import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Demand points\n",
    "demand_points=['Port of Salalah', 'Port of Gaza','Port of Jebel Ali']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Salalah', 'Port of Gaza', 'Port of Jebel Ali']"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "demand_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Supply Points\n",
    "supply_points=['Port of Santos','Sihanoukville','Douala','Port of Shanghai','Puerto Quetzal','Port of Jawaharlal Nehru','Port of Tanjung Priok','Port of Abidjan','Port of Monrovia','Penang Port','Port of Manzanillo','Port of Yangon','Port of Lagos','Port of Manila','Port of  Colombo','Port of Bangkok','Port of Saigon']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['Port of Santos',\n",
       " 'Sihanoukville',\n",
       " 'Douala',\n",
       " 'Port of Shanghai',\n",
       " 'Puerto Quetzal',\n",
       " 'Port of Jawaharlal Nehru',\n",
       " 'Port of Tanjung Priok',\n",
       " 'Port of Abidjan',\n",
       " 'Port of Monrovia',\n",
       " 'Penang Port',\n",
       " 'Port of Manzanillo',\n",
       " 'Port of Yangon',\n",
       " 'Port of Lagos',\n",
       " 'Port of Manila',\n",
       " 'Port of  Colombo',\n",
       " 'Port of Bangkok',\n",
       " 'Port of Saigon']"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "supply_points"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the distances\n",
    "distance = dict(zip(supply_points,[dict(zip(demand_points, [8408,6360,9407])),\n",
    "dict(zip(demand_points, [4256,6126,4613])),\n",
    "dict(zip(demand_points, [7018,5413,8017])),\n",
    "dict(zip(demand_points, [6270,7660,6627])),\n",
    "dict(zip(demand_points, [10937,8500,11949])),\n",
    "dict(zip(demand_points, [1143,3243,1335])),\n",
    "dict(zip(demand_points, [4050,5814,4405])),\n",
    "dict(zip(demand_points, [7569,4594,8568])),\n",
    "dict(zip(demand_points, [6952,4138,7951])),\n",
    "dict(zip(demand_points, [3245,5210,3601])),\n",
    "dict(zip(demand_points, [11791,8088,12790])),\n",
    "dict(zip(demand_points, [3331,5215.2,3687])),\n",
    "dict(zip(demand_points, [7317,5052,8316])),\n",
    "dict(zip(demand_points, [5182,6834,5539])),\n",
    "dict(zip(demand_points, [1920,3991,2276])),\n",
    "dict(zip(demand_points, [4490,6341,4847])),\n",
    "dict(zip(demand_points, [4353,6368,4709]))]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of Salalah': 8408,\n",
       "  'Port of Gaza': 6360,\n",
       "  'Port of Jebel Ali': 9407},\n",
       " 'Sihanoukville': {'Port of Salalah': 4256,\n",
       "  'Port of Gaza': 6126,\n",
       "  'Port of Jebel Ali': 4613},\n",
       " 'Douala': {'Port of Salalah': 7018,\n",
       "  'Port of Gaza': 5413,\n",
       "  'Port of Jebel Ali': 8017},\n",
       " 'Port of Shanghai': {'Port of Salalah': 6270,\n",
       "  'Port of Gaza': 7660,\n",
       "  'Port of Jebel Ali': 6627},\n",
       " 'Puerto Quetzal': {'Port of Salalah': 10937,\n",
       "  'Port of Gaza': 8500,\n",
       "  'Port of Jebel Ali': 11949},\n",
       " 'Port of Jawaharlal Nehru': {'Port of Salalah': 1143,\n",
       "  'Port of Gaza': 3243,\n",
       "  'Port of Jebel Ali': 1335},\n",
       " 'Port of Tanjung Priok': {'Port of Salalah': 4050,\n",
       "  'Port of Gaza': 5814,\n",
       "  'Port of Jebel Ali': 4405},\n",
       " 'Port of Abidjan': {'Port of Salalah': 7569,\n",
       "  'Port of Gaza': 4594,\n",
       "  'Port of Jebel Ali': 8568},\n",
       " 'Port of Monrovia': {'Port of Salalah': 6952,\n",
       "  'Port of Gaza': 4138,\n",
       "  'Port of Jebel Ali': 7951},\n",
       " 'Penang Port': {'Port of Salalah': 3245,\n",
       "  'Port of Gaza': 5210,\n",
       "  'Port of Jebel Ali': 3601},\n",
       " 'Port of Manzanillo': {'Port of Salalah': 11791,\n",
       "  'Port of Gaza': 8088,\n",
       "  'Port of Jebel Ali': 12790},\n",
       " 'Port of Yangon': {'Port of Salalah': 3331,\n",
       "  'Port of Gaza': 5215.2,\n",
       "  'Port of Jebel Ali': 3687},\n",
       " 'Port of Lagos': {'Port of Salalah': 7317,\n",
       "  'Port of Gaza': 5052,\n",
       "  'Port of Jebel Ali': 8316},\n",
       " 'Port of Manila': {'Port of Salalah': 5182,\n",
       "  'Port of Gaza': 6834,\n",
       "  'Port of Jebel Ali': 5539},\n",
       " 'Port of  Colombo': {'Port of Salalah': 1920,\n",
       "  'Port of Gaza': 3991,\n",
       "  'Port of Jebel Ali': 2276},\n",
       " 'Port of Bangkok': {'Port of Salalah': 4490,\n",
       "  'Port of Gaza': 6341,\n",
       "  'Port of Jebel Ali': 4847},\n",
       " 'Port of Saigon': {'Port of Salalah': 4353,\n",
       "  'Port of Gaza': 6368,\n",
       "  'Port of Jebel Ali': 4709}}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Rubber Demand\n",
    "rubber_demand=dict(zip(demand_points, [51754378.63,47500474.23,55015605.9]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Salalah': 51754378.63,\n",
       " 'Port of Gaza': 47500474.23,\n",
       " 'Port of Jebel Ali': 55015605.9}"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rubber_demand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Inputing the Rubber Supply\n",
    "rubber_supply=dict(zip(supply_points, [1258648.2900,8234049.7510,217343.9060,8784079.7960,3935392.5450,6522791.1570,34239646.0300,3411326.1430,603911.1280,5312726.1900,330881.7674,1946363.3380,1386711.0420,2541650.1950,741564.4317,49185954.9800,25617418.0800])) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': 1258648.29,\n",
       " 'Sihanoukville': 8234049.751,\n",
       " 'Douala': 217343.906,\n",
       " 'Port of Shanghai': 8784079.796,\n",
       " 'Puerto Quetzal': 3935392.545,\n",
       " 'Port of Jawaharlal Nehru': 6522791.157,\n",
       " 'Port of Tanjung Priok': 34239646.03,\n",
       " 'Port of Abidjan': 3411326.143,\n",
       " 'Port of Monrovia': 603911.128,\n",
       " 'Penang Port': 5312726.19,\n",
       " 'Port of Manzanillo': 330881.7674,\n",
       " 'Port of Yangon': 1946363.338,\n",
       " 'Port of Lagos': 1386711.042,\n",
       " 'Port of Manila': 2541650.195,\n",
       " 'Port of  Colombo': 741564.4317,\n",
       " 'Port of Bangkok': 49185954.98,\n",
       " 'Port of Saigon': 25617418.08}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rubber_supply"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "prob = LpProblem(\"Transportation\", LpMinimize)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "None\n",
       "VARIABLES"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set Problem Variables\n",
    "routes = [(i,j) for i in supply_points for j in demand_points]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[('Port of Santos', 'Port of Salalah'),\n",
       " ('Port of Santos', 'Port of Gaza'),\n",
       " ('Port of Santos', 'Port of Jebel Ali'),\n",
       " ('Sihanoukville', 'Port of Salalah'),\n",
       " ('Sihanoukville', 'Port of Gaza'),\n",
       " ('Sihanoukville', 'Port of Jebel Ali'),\n",
       " ('Douala', 'Port of Salalah'),\n",
       " ('Douala', 'Port of Gaza'),\n",
       " ('Douala', 'Port of Jebel Ali'),\n",
       " ('Port of Shanghai', 'Port of Salalah'),\n",
       " ('Port of Shanghai', 'Port of Gaza'),\n",
       " ('Port of Shanghai', 'Port of Jebel Ali'),\n",
       " ('Puerto Quetzal', 'Port of Salalah'),\n",
       " ('Puerto Quetzal', 'Port of Gaza'),\n",
       " ('Puerto Quetzal', 'Port of Jebel Ali'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Salalah'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Gaza'),\n",
       " ('Port of Jawaharlal Nehru', 'Port of Jebel Ali'),\n",
       " ('Port of Tanjung Priok', 'Port of Salalah'),\n",
       " ('Port of Tanjung Priok', 'Port of Gaza'),\n",
       " ('Port of Tanjung Priok', 'Port of Jebel Ali'),\n",
       " ('Port of Abidjan', 'Port of Salalah'),\n",
       " ('Port of Abidjan', 'Port of Gaza'),\n",
       " ('Port of Abidjan', 'Port of Jebel Ali'),\n",
       " ('Port of Monrovia', 'Port of Salalah'),\n",
       " ('Port of Monrovia', 'Port of Gaza'),\n",
       " ('Port of Monrovia', 'Port of Jebel Ali'),\n",
       " ('Penang Port', 'Port of Salalah'),\n",
       " ('Penang Port', 'Port of Gaza'),\n",
       " ('Penang Port', 'Port of Jebel Ali'),\n",
       " ('Port of Manzanillo', 'Port of Salalah'),\n",
       " ('Port of Manzanillo', 'Port of Gaza'),\n",
       " ('Port of Manzanillo', 'Port of Jebel Ali'),\n",
       " ('Port of Yangon', 'Port of Salalah'),\n",
       " ('Port of Yangon', 'Port of Gaza'),\n",
       " ('Port of Yangon', 'Port of Jebel Ali'),\n",
       " ('Port of Lagos', 'Port of Salalah'),\n",
       " ('Port of Lagos', 'Port of Gaza'),\n",
       " ('Port of Lagos', 'Port of Jebel Ali'),\n",
       " ('Port of Manila', 'Port of Salalah'),\n",
       " ('Port of Manila', 'Port of Gaza'),\n",
       " ('Port of Manila', 'Port of Jebel Ali'),\n",
       " ('Port of  Colombo', 'Port of Salalah'),\n",
       " ('Port of  Colombo', 'Port of Gaza'),\n",
       " ('Port of  Colombo', 'Port of Jebel Ali'),\n",
       " ('Port of Bangkok', 'Port of Salalah'),\n",
       " ('Port of Bangkok', 'Port of Gaza'),\n",
       " ('Port of Bangkok', 'Port of Jebel Ali'),\n",
       " ('Port of Saigon', 'Port of Salalah'),\n",
       " ('Port of Saigon', 'Port of Gaza'),\n",
       " ('Port of Saigon', 'Port of Jebel Ali')]"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "routes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Decision Variables\n",
    "X = LpVariable.dicts(\"ShipmentAmount\",(supply_points, demand_points),0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Port of Santos': {'Port of Salalah': ShipmentAmount_Port_of_Santos_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Santos_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali},\n",
       " 'Sihanoukville': {'Port of Salalah': ShipmentAmount_Sihanoukville_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Sihanoukville_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali},\n",
       " 'Douala': {'Port of Salalah': ShipmentAmount_Douala_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Douala_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Douala_Port_of_Jebel_Ali},\n",
       " 'Port of Shanghai': {'Port of Salalah': ShipmentAmount_Port_of_Shanghai_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Shanghai_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali},\n",
       " 'Puerto Quetzal': {'Port of Salalah': ShipmentAmount_Puerto_Quetzal_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Puerto_Quetzal_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali},\n",
       " 'Port of Jawaharlal Nehru': {'Port of Salalah': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali},\n",
       " 'Port of Tanjung Priok': {'Port of Salalah': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali},\n",
       " 'Port of Abidjan': {'Port of Salalah': ShipmentAmount_Port_of_Abidjan_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Abidjan_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali},\n",
       " 'Port of Monrovia': {'Port of Salalah': ShipmentAmount_Port_of_Monrovia_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Monrovia_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali},\n",
       " 'Penang Port': {'Port of Salalah': ShipmentAmount_Penang_Port_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Penang_Port_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Penang_Port_Port_of_Jebel_Ali},\n",
       " 'Port of Manzanillo': {'Port of Salalah': ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali},\n",
       " 'Port of Yangon': {'Port of Salalah': ShipmentAmount_Port_of_Yangon_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Yangon_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali},\n",
       " 'Port of Lagos': {'Port of Salalah': ShipmentAmount_Port_of_Lagos_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Lagos_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali},\n",
       " 'Port of Manila': {'Port of Salalah': ShipmentAmount_Port_of_Manila_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Manila_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali},\n",
       " 'Port of  Colombo': {'Port of Salalah': ShipmentAmount_Port_of__Colombo_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of__Colombo_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali},\n",
       " 'Port of Bangkok': {'Port of Salalah': ShipmentAmount_Port_of_Bangkok_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Bangkok_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali},\n",
       " 'Port of Saigon': {'Port of Salalah': ShipmentAmount_Port_of_Saigon_Port_of_Salalah,\n",
       "  'Port of Gaza': ShipmentAmount_Port_of_Saigon_Port_of_Gaza,\n",
       "  'Port of Jebel Ali': ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali}}"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Objective Function\n",
    "prob += sum(X[i][j]*distance[i][j] for (i,j) in routes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5413*ShipmentAmount_Douala_Port_of_Gaza + 8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 7018*ShipmentAmount_Douala_Port_of_Salalah + 5210*ShipmentAmount_Penang_Port_Port_of_Gaza + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3245*ShipmentAmount_Penang_Port_Port_of_Salalah + 4594*ShipmentAmount_Port_of_Abidjan_Port_of_Gaza + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 7569*ShipmentAmount_Port_of_Abidjan_Port_of_Salalah + 6341*ShipmentAmount_Port_of_Bangkok_Port_of_Gaza + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 4490*ShipmentAmount_Port_of_Bangkok_Port_of_Salalah + 3243*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1143*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah + 5052*ShipmentAmount_Port_of_Lagos_Port_of_Gaza + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 7317*ShipmentAmount_Port_of_Lagos_Port_of_Salalah + 6834*ShipmentAmount_Port_of_Manila_Port_of_Gaza + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5182*ShipmentAmount_Port_of_Manila_Port_of_Salalah + 8088*ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 11791*ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah + 4138*ShipmentAmount_Port_of_Monrovia_Port_of_Gaza + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 6952*ShipmentAmount_Port_of_Monrovia_Port_of_Salalah + 6368*ShipmentAmount_Port_of_Saigon_Port_of_Gaza + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 4353*ShipmentAmount_Port_of_Saigon_Port_of_Salalah + 6360*ShipmentAmount_Port_of_Santos_Port_of_Gaza + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 8408*ShipmentAmount_Port_of_Santos_Port_of_Salalah + 7660*ShipmentAmount_Port_of_Shanghai_Port_of_Gaza + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6270*ShipmentAmount_Port_of_Shanghai_Port_of_Salalah + 5814*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4050*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah + 5215.2*ShipmentAmount_Port_of_Yangon_Port_of_Gaza + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3331*ShipmentAmount_Port_of_Yangon_Port_of_Salalah + 3991*ShipmentAmount_Port_of__Colombo_Port_of_Gaza + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 1920*ShipmentAmount_Port_of__Colombo_Port_of_Salalah + 8500*ShipmentAmount_Puerto_Quetzal_Port_of_Gaza + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 10937*ShipmentAmount_Puerto_Quetzal_Port_of_Salalah + 6126*ShipmentAmount_Sihanoukville_Port_of_Gaza + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4256*ShipmentAmount_Sihanoukville_Port_of_Salalah + 0.0\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Salalah Continuous"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5413*ShipmentAmount_Douala_Port_of_Gaza + 8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 7018*ShipmentAmount_Douala_Port_of_Salalah + 5210*ShipmentAmount_Penang_Port_Port_of_Gaza + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3245*ShipmentAmount_Penang_Port_Port_of_Salalah + 4594*ShipmentAmount_Port_of_Abidjan_Port_of_Gaza + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 7569*ShipmentAmount_Port_of_Abidjan_Port_of_Salalah + 6341*ShipmentAmount_Port_of_Bangkok_Port_of_Gaza + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 4490*ShipmentAmount_Port_of_Bangkok_Port_of_Salalah + 3243*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1143*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah + 5052*ShipmentAmount_Port_of_Lagos_Port_of_Gaza + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 7317*ShipmentAmount_Port_of_Lagos_Port_of_Salalah + 6834*ShipmentAmount_Port_of_Manila_Port_of_Gaza + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5182*ShipmentAmount_Port_of_Manila_Port_of_Salalah + 8088*ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 11791*ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah + 4138*ShipmentAmount_Port_of_Monrovia_Port_of_Gaza + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 6952*ShipmentAmount_Port_of_Monrovia_Port_of_Salalah + 6368*ShipmentAmount_Port_of_Saigon_Port_of_Gaza + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 4353*ShipmentAmount_Port_of_Saigon_Port_of_Salalah + 6360*ShipmentAmount_Port_of_Santos_Port_of_Gaza + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 8408*ShipmentAmount_Port_of_Santos_Port_of_Salalah + 7660*ShipmentAmount_Port_of_Shanghai_Port_of_Gaza + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6270*ShipmentAmount_Port_of_Shanghai_Port_of_Salalah + 5814*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4050*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah + 5215.2*ShipmentAmount_Port_of_Yangon_Port_of_Gaza + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3331*ShipmentAmount_Port_of_Yangon_Port_of_Salalah + 3991*ShipmentAmount_Port_of__Colombo_Port_of_Gaza + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 1920*ShipmentAmount_Port_of__Colombo_Port_of_Salalah + 8500*ShipmentAmount_Puerto_Quetzal_Port_of_Gaza + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 10937*ShipmentAmount_Puerto_Quetzal_Port_of_Salalah + 6126*ShipmentAmount_Sihanoukville_Port_of_Gaza + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4256*ShipmentAmount_Sihanoukville_Port_of_Salalah + 0.0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Douala_Port_of_Salalah\n",
       " + ShipmentAmount_Penang_Port_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Salalah\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Salalah\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Salalah >= 51754378.63\n",
       "\n",
       "_C2: ShipmentAmount_Douala_Port_of_Gaza\n",
       " + ShipmentAmount_Penang_Port_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Gaza\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Gaza\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Gaza >= 47500474.23\n",
       "\n",
       "_C3: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali >= 55015605.9\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Salalah Continuous"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for j in demand_points:\n",
    "    prob += sum(X[i][j] for i in supply_points) >= rubber_demand[j]\n",
    "    \n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Transportation:\n",
       "MINIMIZE\n",
       "5413*ShipmentAmount_Douala_Port_of_Gaza + 8017*ShipmentAmount_Douala_Port_of_Jebel_Ali + 7018*ShipmentAmount_Douala_Port_of_Salalah + 5210*ShipmentAmount_Penang_Port_Port_of_Gaza + 3601*ShipmentAmount_Penang_Port_Port_of_Jebel_Ali + 3245*ShipmentAmount_Penang_Port_Port_of_Salalah + 4594*ShipmentAmount_Port_of_Abidjan_Port_of_Gaza + 8568*ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali + 7569*ShipmentAmount_Port_of_Abidjan_Port_of_Salalah + 6341*ShipmentAmount_Port_of_Bangkok_Port_of_Gaza + 4847*ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali + 4490*ShipmentAmount_Port_of_Bangkok_Port_of_Salalah + 3243*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza + 1335*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali + 1143*ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah + 5052*ShipmentAmount_Port_of_Lagos_Port_of_Gaza + 8316*ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali + 7317*ShipmentAmount_Port_of_Lagos_Port_of_Salalah + 6834*ShipmentAmount_Port_of_Manila_Port_of_Gaza + 5539*ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali + 5182*ShipmentAmount_Port_of_Manila_Port_of_Salalah + 8088*ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza + 12790*ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali + 11791*ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah + 4138*ShipmentAmount_Port_of_Monrovia_Port_of_Gaza + 7951*ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali + 6952*ShipmentAmount_Port_of_Monrovia_Port_of_Salalah + 6368*ShipmentAmount_Port_of_Saigon_Port_of_Gaza + 4709*ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali + 4353*ShipmentAmount_Port_of_Saigon_Port_of_Salalah + 6360*ShipmentAmount_Port_of_Santos_Port_of_Gaza + 9407*ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali + 8408*ShipmentAmount_Port_of_Santos_Port_of_Salalah + 7660*ShipmentAmount_Port_of_Shanghai_Port_of_Gaza + 6627*ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali + 6270*ShipmentAmount_Port_of_Shanghai_Port_of_Salalah + 5814*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza + 4405*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali + 4050*ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah + 5215.2*ShipmentAmount_Port_of_Yangon_Port_of_Gaza + 3687*ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali + 3331*ShipmentAmount_Port_of_Yangon_Port_of_Salalah + 3991*ShipmentAmount_Port_of__Colombo_Port_of_Gaza + 2276*ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali + 1920*ShipmentAmount_Port_of__Colombo_Port_of_Salalah + 8500*ShipmentAmount_Puerto_Quetzal_Port_of_Gaza + 11949*ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali + 10937*ShipmentAmount_Puerto_Quetzal_Port_of_Salalah + 6126*ShipmentAmount_Sihanoukville_Port_of_Gaza + 4613*ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali + 4256*ShipmentAmount_Sihanoukville_Port_of_Salalah + 0.0\n",
       "SUBJECT TO\n",
       "_C1: ShipmentAmount_Douala_Port_of_Salalah\n",
       " + ShipmentAmount_Penang_Port_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Salalah\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Salalah\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Salalah\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Salalah >= 51754378.63\n",
       "\n",
       "_C2: ShipmentAmount_Douala_Port_of_Gaza\n",
       " + ShipmentAmount_Penang_Port_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Gaza\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Gaza\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Gaza >= 47500474.23\n",
       "\n",
       "_C3: ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali >= 55015605.9\n",
       "\n",
       "_C4: ShipmentAmount_Port_of_Santos_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Santos_Port_of_Salalah = 1258648.29\n",
       "\n",
       "_C5: ShipmentAmount_Sihanoukville_Port_of_Gaza\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Sihanoukville_Port_of_Salalah = 8234049.751\n",
       "\n",
       "_C6: ShipmentAmount_Douala_Port_of_Gaza\n",
       " + ShipmentAmount_Douala_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Douala_Port_of_Salalah = 217343.906\n",
       "\n",
       "_C7: ShipmentAmount_Port_of_Shanghai_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Shanghai_Port_of_Salalah = 8784079.796\n",
       "\n",
       "_C8: ShipmentAmount_Puerto_Quetzal_Port_of_Gaza\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Puerto_Quetzal_Port_of_Salalah = 3935392.545\n",
       "\n",
       "_C9: ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah = 6522791.157\n",
       "\n",
       "_C10: ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah = 34239646.03\n",
       "\n",
       "_C11: ShipmentAmount_Port_of_Abidjan_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Abidjan_Port_of_Salalah = 3411326.143\n",
       "\n",
       "_C12: ShipmentAmount_Port_of_Monrovia_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Monrovia_Port_of_Salalah = 603911.128\n",
       "\n",
       "_C13: ShipmentAmount_Penang_Port_Port_of_Gaza\n",
       " + ShipmentAmount_Penang_Port_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Penang_Port_Port_of_Salalah = 5312726.19\n",
       "\n",
       "_C14: ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah = 330881.7674\n",
       "\n",
       "_C15: ShipmentAmount_Port_of_Yangon_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Yangon_Port_of_Salalah = 1946363.338\n",
       "\n",
       "_C16: ShipmentAmount_Port_of_Lagos_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Lagos_Port_of_Salalah = 1386711.042\n",
       "\n",
       "_C17: ShipmentAmount_Port_of_Manila_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Manila_Port_of_Salalah = 2541650.195\n",
       "\n",
       "_C18: ShipmentAmount_Port_of__Colombo_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of__Colombo_Port_of_Salalah = 741564.4317\n",
       "\n",
       "_C19: ShipmentAmount_Port_of_Bangkok_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Bangkok_Port_of_Salalah = 49185954.98\n",
       "\n",
       "_C20: ShipmentAmount_Port_of_Saigon_Port_of_Gaza\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali\n",
       " + ShipmentAmount_Port_of_Saigon_Port_of_Salalah = 25617418.08\n",
       "\n",
       "VARIABLES\n",
       "ShipmentAmount_Douala_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Douala_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Douala_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Penang_Port_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Abidjan_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Bangkok_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Lagos_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manila_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Manzanillo_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Monrovia_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Saigon_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Santos_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Shanghai_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of_Yangon_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Port_of__Colombo_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Puerto_Quetzal_Port_of_Salalah Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Gaza Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Jebel_Ali Continuous\n",
       "ShipmentAmount_Sihanoukville_Port_of_Salalah Continuous"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Constraints\n",
    "for i in supply_points:\n",
    "    prob += sum(X[i][j] for j in demand_points) == rubber_supply[i]\n",
    "prob"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Status: Optimal\n",
      "ShipmentAmount_Douala_Port_of_Gaza = 217343.91\n",
      "ShipmentAmount_Penang_Port_Port_of_Jebel_Ali = 5312726.2\n",
      "ShipmentAmount_Port_of_Abidjan_Port_of_Gaza = 3411326.1\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_Jebel_Ali = 5665626.1\n",
      "ShipmentAmount_Port_of_Bangkok_Port_of_Salalah = 43520329.0\n",
      "ShipmentAmount_Port_of_Jawaharlal_Nehru_Port_of_Jebel_Ali = 6522791.2\n",
      "ShipmentAmount_Port_of_Lagos_Port_of_Gaza = 1386711.0\n",
      "ShipmentAmount_Port_of_Manila_Port_of_Gaza = 2541650.2\n",
      "ShipmentAmount_Port_of_Manzanillo_Port_of_Gaza = 330881.77\n",
      "ShipmentAmount_Port_of_Monrovia_Port_of_Gaza = 603911.13\n",
      "ShipmentAmount_Port_of_Saigon_Port_of_Jebel_Ali = 25617418.0\n",
      "ShipmentAmount_Port_of_Santos_Port_of_Gaza = 1258648.3\n",
      "ShipmentAmount_Port_of_Shanghai_Port_of_Gaza = 8784079.8\n",
      "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Gaza = 25030529.0\n",
      "ShipmentAmount_Port_of_Tanjung_Priok_Port_of_Jebel_Ali = 9209116.6\n",
      "ShipmentAmount_Port_of_Yangon_Port_of_Jebel_Ali = 1946363.3\n",
      "ShipmentAmount_Port_of__Colombo_Port_of_Jebel_Ali = 741564.43\n",
      "ShipmentAmount_Puerto_Quetzal_Port_of_Gaza = 3935392.5\n",
      "ShipmentAmount_Sihanoukville_Port_of_Salalah = 8234049.8\n",
      "Total kilogram_miles = 756481316729.21\n"
     ]
    }
   ],
   "source": [
    "prob.solve()\n",
    "\n",
    "print(\"Status:\", LpStatus[prob.status])\n",
    "\n",
    "for v in prob.variables():\n",
    "    if v.varValue > 0:\n",
    "        print(v.name, \"=\", v.varValue)\n",
    "\n",
    "print(\"Total kilogram_miles =\", value(prob.objective))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
